<div [formGroup]="fieldForm">
    <div class="form-group row mb-3">
        <div class="col-9 offset-3">
            <div class="form-check">
                <input class="form-check-input" id="{{ field.fieldId }}_fieldRequired" formControlName="isRequired" type="checkbox" />
                <label class="form-check-label" for="{{ field.fieldId }}_fieldRequired">
                    {{ "schemas.field.required" | sqxTranslate }}
                </label>
            </div>
        </div>
    </div>

    <div class="form-group row mb-3">
        <div class="col-9 offset-3">
            <div class="form-check">
                <input class="form-check-input" id="{{ field.fieldId }}_fieldRequiredOnPublish" formControlName="isRequiredOnPublish" type="checkbox" />
                <label class="form-check-label" for="{{ field.fieldId }}_fieldRequiredOnPublish">
                    {{ "schemas.field.requiredOnPublish" | sqxTranslate }}
                </label>
            </div>
        </div>
    </div>
</div>

@switch (field.rawProperties.fieldType) {
    @case ("Array") {
        <sqx-array-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("Assets") {
        <sqx-assets-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties" />
    }

    @case ("Boolean") {
        <sqx-boolean-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties" />
    }

    @case ("Component") {
        <sqx-component-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("Components") {
        <sqx-components-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("DateTime") {
        <sqx-date-time-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties" />
    }

    @case ("Geolocation") {
        <sqx-geolocation-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("Json") {
        <sqx-json-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("Number") {
        <sqx-number-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties"
            [schema]="schema" />
    }

    @case ("References") {
        <sqx-references-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties" />
    }

    @case ("RichText") {
        <sqx-rich-text-validation [field]="field" [fieldForm]="fieldForm" [properties]="field.rawProperties" />
    }

    @case ("String") {
        <sqx-string-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties"
            [schema]="schema"
            [settings]="settings" />
    }

    @case ("Tags") {
        <sqx-tags-validation
            [field]="field"
            [fieldForm]="fieldForm"
            [isLocalizable]="isLocalizable"
            [languages]="languages"
            [properties]="field.rawProperties" />
    }
}
